/**
 * Created by zhenggongbu on 2016-04-11.
 */
/**
 * Created by zhenggongbu on 2016-04-06.
 */

$("#tohoot").click(function(){
    $("#tohoot").css("color","black")
    alert("1")
});
//$(document).ready(function () {
//    getWH();
//    //动态获取页面和屏幕宽高
//    $(window).resize(function () {
//        if (getPageSize()[0] < 480) {
//            window.resizeTo(document.body.clientWidth, 480);
//        } else {
//            getWH();
//        }
//    })
//});
/*最新、最热跳转*/
function gaibian(v){
    console.log($($(v).find("a"))[0].innerText);
    var s=$($(v).find("a"))[0].innerText;
    window.location.href="ViewDetails.html?id="+s+"";
    //console.log($(this>p)[0].innerText);
}
$(".change-veiw").on("tap",function(){
    //$(this).css("background-color","rgba(0, 0, 0, 0.1)");
    $(this)[0].value=2;
    //console.log($(this>a)[0]);
    $.mobile.changePage("ViewDetails.html?="+$(this)[0].value+"","pop");
    location.reload([bForceGet]);
    //$.ajax({ url: "ViewDetails.html?id=1", context: document.body, success: function(){
    //    $(this).addClass("done");
    //}});
});
$("#to-hot").on("tap",function(){
    window.location.href="the-news2.html";
});
$("#to-zx").on("tap",function(){
    window.location.href="the-news.html";
});
window.onload=function(){
    setInterval(navbind,10)
};

/*angularjs*/
var myApp2=angular.module("myApp2",[]);//定义模块，[]代表组件，如果没有就为空，但不能删除，必须要
myApp2.controller("thenews2",function($scope,$http){
    $scope.findbook2=function(){
        $http.get("thenews2.do").success(function(data){
            //var msgdata=JSON.parse(data);
            $scope.msg2=data;
            console.log(data);
            //处理日期数据
            for(var i=0;i<=data.length-1;i++){
                //console.log(typeof (data[i].publish_date));
                var strs= new Array(); //定义一数组
                strs=data[i].publish_date.split("T"); //字符分割
                console.log(strs[0]);
                data[i].publish_date=strs[0];

            }
            console.log(data);
        })
    }
});